from base.mybase import Tools


class cancel_model(Tools):
    path = '/task/info'

    def cancel_action(self, task_id, hd):
        cancel_data = {
            "task_id": task_id
        }
        cancel = self.huihua.put(url=self.hosturl + self.path, data=cancel_data, headers=hd)
        return cancel.json()


# from todo_api_project.api.login_api import login_model
# import requests
# s = requests.session()
# login = login_model(huihua=s)
# msg = login.login_action(usr='rrer123', pwd='rr1234', check='1234')
# print(msg)
# getuserId = msg['userId']
# getuserToken = msg['userToken']
# hd = {"userId": getuserId, "userToken": getuserToken}
#
# cancel1 = cancel_model(huihua=s)
# msg = cancel1.cancel_action(task_id="16835433466667938", hd=hd)
# print(msg)
